extends ../layout

block content
  style.
    body{background: #2e3c4c;}
  .container
    .row   
      div(style="height:50px;")
      if categories.length > 0 
        each cat in categories
          if cat.articles && cat.articles.length > 0
            .panel.panel-default
                .panel-heading
                  h3
                    a(href='') #{cat.name}
                .panel-body
                  each item in cat.articles
                    .col-md-2
                      .thumbnail
                        a(href="/admin/article/#{item._id}")
                          if item.poster
                            img(src="#{item.poster}", alt="#{item.title}")
                          else
                            img(src="/images/no_img.png", alt="#{item.title}")
                        .caption
                          h4 #{item.title}
                          p #{item.abstract}
                          p
                           a.btn.btn-primary(href="/admin/article/#{item._id}") 查看详情
      else
        .jumbotron
          p 等待大文豪书写文章哦!!
          p
            a.btn.btn-primary(href="admin/article/new") 创建文章
  